Skip to content

compiler bug: error: pointer expected #24622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
keiravillekode opened this issue May 31, 2025 · 1 comment · May be fixed by #19100
Open

compiler bug: error: pointer expected #24622

keiravillekode opened this issue May 31, 2025 · 1 comment · May be fixed by #19100
Assignees
Labels
Bug This tag is applied to issues which reports bugs. Option Type Bugs/feature requests, that are related to `?Type`. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.

Comments

@keiravillekode
Copy link

keiravillekode commented May 31, 2025

Describe the bug

Compiler crash

Reproduction Steps

$ v version
V 0.4.10 21da729
$ v test temp/run_test.v
---- Testing... ----------------------------------------------------------------------------
 FAIL     0.000 ms .../temp/run_test.v
>> compilation failed:
================== C compilation error (from tcc): ==============
cc: .....tmp.c:3088: error: pointer expected
=================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
builder error: 
==================
C error found. It should never happen, when compiling pure V code.
This is a V compiler bug

temp/f.v

module main

struct Solution {
}

fn f() !Solution {
	mut solution := ?Solution(none)

	g := fn (mut solution ?Solution) ! {
		solution = Solution {}
	}

	g(mut &solution)!

	return error('')
}

temp/run_test.v

module main

fn test_f() {
	assert f()! == Solution {}
}

Expected Behavior

Helpful message

Current Behavior

Compiler crash

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.10 21da729

Environment details (OS name and version, etc.)

Linux 6.11.0-26-generic #26~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC x86_64

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@keiravillekode keiravillekode added the Bug This tag is applied to issues which reports bugs. label May 31, 2025
Copy link

Connected to Huly®: V_0.6-22983

@felipensp felipensp added Option Type Bugs/feature requests, that are related to `?Type`. Unit: cgen Bugs/feature requests, that are related to the default C generating backend. labels May 31, 2025
@felipensp felipensp linked a pull request Jun 1, 2025 that will close this issue
@felipensp felipensp self-assigned this Jun 1, 2025
@felipensp felipensp added the Status: Confirmed This bug has been confirmed to be valid by a contributor. label Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Option Type Bugs/feature requests, that are related to `?Type`. Status: Confirmed This bug has been confirmed to be valid by a contributor. Unit: cgen Bugs/feature requests, that are related to the default C generating backend.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants